<?php
$this->pageTitle=Yii::app()->name . ' - Login';

?>

<h1>Login</h1>
<?php if(Yii::app()->user->isGuest):?>
<div class="form">
    <?php echo CHtml::beginForm(); ?>

    <?php echo CHtml::errorSummary($model); ?>

    <div class="row">
        <?php echo CHtml::activeLabelEx($model,'username'); ?>
        <?php echo CHtml::activeTextField($model,'username'); ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabelEx($model,'password'); ?>
        <?php echo CHtml::activePasswordField($model,'password'); ?>
    </div>

    <div class="row rememberMe">
        <?php echo CHtml::activeLabel($model,'rememberMe'); ?>
        <?php echo CHtml::activeCheckBox($model,'rememberMe', array('class'=>'checkbox')); ?>
    </div>

    <div class="row submit">
        <?php echo CHtml::submitButton('Login'); ?>
    </div>

    <?php echo CHtml::endForm(); ?>
</div><!-- form -->
<?php else: ?>
<?php $this->renderPartial('message', array('message'=>'Jesteś już zalogowany.')) ?>
<?php endif; ?>
